package com.heima.admin.controller.v1;

import com.heima.apis.wemedia.IWeUserClient;
import com.heima.model.admin.dtos.NewsAuthDto;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/api/v1/news")
public class AdWmNewsController {

    @Autowired
    private IWeUserClient weNewsClient;
    @PostMapping("/list_vo")
    public PageResponseResult findListByVo(@RequestBody NewsAuthDto newsAuthDto){
        return weNewsClient.findListByVo(newsAuthDto);
    }
    @PostMapping("/auth_fail")
    public ResponseResult authFail(@RequestBody NewsAuthDto newsAuthDto){
        return weNewsClient.authFail(newsAuthDto);
    }
    @GetMapping("/one_vo/{id}")
    ResponseResult findOneById(@PathVariable Integer id){
        return weNewsClient.findOneById(id);
    }
}
